package com.tuars.instalacionesalberti.vistas.preferencias;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JColorChooser;
import javax.swing.JDialog;
import javax.swing.JButton;

@SuppressWarnings("serial")
public class VistaPrincipalPreferencias extends JDialog{
	
	private ImageIcon favicon;

	/**
	 * Create the dialog.
	 */
	private JColorChooser jColor;
	
	public VistaPrincipalPreferencias() {
		setBounds(100, 100, 610, 550);
		getContentPane().setLayout(null);
		setTitle("Preferencias");
		
		/**
		 * Favicon
		 */
		favicon = new ImageIcon("imatges/favicon.gif");
		this.setIconImage(favicon.getImage());
		
		jColor = new JColorChooser();
		getContentPane().add(jColor);
		jColor.setBounds(98, 56, 458, 244);
		
		JButton btnAceptar = new JButton("Aceptar");
		btnAceptar.setBounds(467, 311, 89, 23);
		getContentPane().add(btnAceptar);
		btnAceptar.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				VistaPrincipalPreferencias.this.setBackground(jColor.getColor());
				System.out.println("ENTRA");
			}
		});
		
	}
}
